<template>
    <header class="header" :class="{ 'home-page-style': isCurrentRoute('/') }">
        <h1 class="logo">XAUAT iOS Club</h1>

        <nav class="navbar">
            <ul class="nav-menu">
                <li class="nav-item"><router-link to="/">主页</router-link></li>
                <li class="nav-item"><router-link to="/about">关于</router-link></li>
                <li class="nav-item"><router-link to="/events">活动</router-link></li>
                <li class="nav-item"><router-link to="/login">个人中心</router-link></li>
            </ul>
        </nav>
    </header>
</template>

<script>
export default {
    methods: {
        isCurrentRoute(routePath) {
            // 使用 $route.path 判断是否与指定路由地址相等
            return this.$route.path === routePath;
        }
    }
};
</script>

<style scoped>
nav {
    color: #fff;
}


h1{
  color: #f5f5f7;
}

h5{
  color: #f5f5f7;
}

ul {
    display: flex;
    list-style: none;
    padding: 0;
}

li {
    margin-right: 10px;
}

a {
    color: #fff;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.header {
    padding-left: 10px;
    padding-right: 10px;
    color: #333;
    border-radius: 10px;
    /* 添加圆角 */
    overflow: hidden;
    /* 防止子元素超出边界 */
    display: flex;
    align-items: center;
    justify-content: space-between;

    background: rgba(255, 255, 255, 0.3);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    box-shadow: inset 0 0 6px rgba(255, 255, 255, 0.3);
}

.logo {
    font-size: 24px;
    font-weight: bold;
}


.nav-menu {
    list-style: none;
    display: flex;
    gap: 20px;
}


.nav-item {
    font-size: 18px;
}

.nav-item a {
    //color: #000000;
  color: #f5f5f7;
    text-decoration: none;
    transition: color 0.3s;
}

.nav-item a:hover {
    color: #e064b9;
}

.home-page-style {
    scroll-snap-align: end;
}
</style>
<script setup>
</script>